import { GetOrderItemTmpFromLocal, SaveOrderItemTmpToLocal } from '@/utils/storage'

export default {
  namespaced: true,
  state () {
    return {
      orderItemTmp: GetOrderItemTmpFromLocal(),
      orderList: []
    }
  },
  mutations: {
    setOrderItemTmp (state, obj) {
      const { cartGoodsList, deliveryType } = obj
      state.orderItemTmp.cartGoodsList = cartGoodsList
      state.orderItemTmp.deliveryType = deliveryType

      SaveOrderItemTmpToLocal(state.orderItemTmp)
    }
  },
  actions: {

  }
}
